<%@ page language="java" import="java.util.*,com.javabean.*,com.model.*,java.sql.*, java.text.*,java.util.Date.*,java.text.SimpleDateFormat.*,java.util.Calendar" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";

int userGrade = ((User) request.getSession(true).getAttribute("user")).getUserGrade();
long userId = ((User) request.getSession(true).getAttribute("user")).getUserId();
List<String> time = new ArrayList<String>(){{
	add("上午8:30-10:00");
	add("上午10:30-12:00");
	add("下午14:30-16:00");
	add("下午16:30-18:00");
}};
List<String> room = new ArrayList<String>(){{
	add("B2-617");
	add("B2-708");
	add("B2-810");
	add("B2-811");
}};
Connection con = DataBase.getConnection();
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
PreparedStatement pstmt = con.prepareStatement("SELECT ReserveDate,RoomID,OccupyTime,ReserverName FROM meetingroom WHERE State=3 AND ReserveDate>=? AND UserId=?");
pstmt.setString(1, df.format(new java.util.Date()));
pstmt.setLong(2, userId);
ResultSet rs = pstmt.executeQuery();
%>

<!DOCTYPE html>
<html>

<head>
<title>信息管理平台</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script src="../jqueryui/js/jquery-1.9.0.js"></script>

<script type="text/javascript" src="../js/clock2.js"></script>
<script type="text/javascript" src="../js/jQueryRotate.2.2.js"></script>
<script src="../jqueryui/js/jquery-ui-1.10.0.custom.min.js"></script>
<script src="../js/index.js" type="text/javascript"></script>

<link rel="stylesheet" type="text/css"
	href="../jqueryui/css/smoothness/jquery-ui-1.10.0.custom.min.css" />
<link rel="stylesheet" type="text/css" href="../css/index_style.css" />
 
</head>

<body>
<div class="mainArticle" id="mainArticle">
    <div class="header" id="header">
    <img id="headerImg" src=""/>
    <div class="headerBar" id="headerBar">
    	<div id="userMes" class="userMes">
        	<div id="userName" class="userName">
				<b>您好！  
				<%=((User)request.getSession(true).getAttribute("user")).getUserName() %>老师！</b>
				<input id="button0" class="logout" type="button" value="注销"
					onclick="loginOut();" />
			</div>
			<div id="userCtr" class="userCtr">
				<input id="button1" type="button" value="修改用户信息"
					onclick="create('userMes');" />
				<input id="button2" type="button" value="修改密码"
					onclick="create('userPas');" />
				<%if(userGrade==15){%>
				<input id="button3" type="button" value="用户管理"
					onclick="create('user');"/>
				<%} %>
			</div>
		</div>	
	</div>	
    </div>
    <div class="content">
        <div id="selectArticle" class="selectArticle">
			<div id="selectFrame" class="selectFrame">
				<div id="accordion">
				<!--  <h1 style="font-weight: bolder">
					<a>地图查询</a>
				</h1>
				<div>
					<h2 >
						<a href="javascript:" onclick="create('map');">餐饮</a>
					</h2>
					<h2 >
						<a href="javascript:" onclick="create('map');">住宿</a>
					</h2>
					<h2 >
						<a href="javascript:" onclick="create('map');">旅游</a>
					</h2>  
				</div>
				<h1 style="font-weight: bolder">
					<a>校内导览</a>
				</h1>
				<div>
					<h2 >
						<a href="javascript:" onclick="create('route');">清水河校区</a>
					</h2>
					<h2 >
						<a>沙河校区</a>
					</h2>
				</div> -->
                <h1>
					<a>会议室管理</a>
				</h1>
				<div>
					<h2>
						<a href="javascript:" onclick="create('HYCX');">会议室查询</a>
					</h2>
					<h2>
						<a href="javascript:" onclick="create('HYYY');">会议室预约</a>
					</h2>
					<%if(userGrade==15){%>
					<h2>
						<a href="javascript:" onclick="create('HYGL');">会议室管理</a>
					</h2>
					<%} %>
				</div>
				</div>
            </div>
            <div id="clockTime" align="center">
            <%
            Calendar c = Calendar.getInstance();//可以对每个时间域单独修改
            int year = c.get(Calendar.YEAR);
            int month = c.get(Calendar.MONTH)+1;
            int date = c.get(Calendar.DATE);
            SimpleDateFormat formatD=new SimpleDateFormat("E");
            String week=formatD.format(new java.util.Date());
            String day="    "+year+"年"+month+"月"+date+"日"+" "+week;
            ;
           
            %>
            <%=day %>
            </div>
            <div id="centered">
           
           
            <div id="html5-clock" ></div>
           
            
       		</div>
				<script>
				
					$(function() {

						//if($.browser.msie){

						var browser = navigator.appName;
						var b_version = navigator.appVersion;
						var version = parseFloat(b_version);
						
						if ((browser == "Netscape" || browser == "Microsoft Internet Explorer")

								&& (version > 4)) {
							
						//if(navigator.appName!="Microsoft Internet Explorer")
						var config = {

							/*the name of the div containing the clock*/
							divId : "html5-clock",

							/*set to false if you don't want to use the second hand*/
							useSecondHand : "true",

							/*width and height of the clock*/
							clockWidthAndHeight : "200",

							/*location of the images*/
							clockFaceImg : "../image/clockBg.png",
							hourHandImg : "../image/hourHand.png",
							minuteHandImg : "../image/minuteHand.png",
							secondHandImg : "../image/secondHand.png",
							/*location of the high res images for retina display*/
							clockFaceHighResImg : "../image/clockBgHighRes.png",
							hourHandHighResImg : "../image/hourHandHighRes.png",
							minuteHandHighResImg : "../image/minuteHandHighRes.png",
							secondHandHighResImg : "../image/secondHandHighRes.png",

							/*Set true to make hand move at steady speed*/
							smoothRotation : "false",

							/*speed of the second hand. Lower is faster. */
							/*Must be under 1000. */
							/*If smooth rotation is true, this does nothing.*/
							secondHandSpeed : "100"

						};

						var myhtml5Clock = new html5Clock(config);
						} else {
							alert("请升级您的浏览器或者使用极速模式！");
						}
						create('HYCX');
					})
				</script>

			</div>
        <div id="targetArticle" class="targetArticle">
            <iframe id="targetFrame" class="targetFrame"></iframe>
        </div>
    </div>
    <div class="footer" id="footer">
        <div>
        	<a href="http://www.uestc.edu.cn/" target="_blank">· 电子科技大学主页</a>
        	<a href="http://mail.uestc.edu.cn/" target="_blank">· 教师邮件系统</a>
        	<a href="http://portal.uestc.edu.cn/" target="_blank">· 信息门户系统</a>
        	<a href="http://202.112.14.185/department/default.aspx?site=64" target="_blank">· 学校办公室</a>
        </div>
    </div>
    <div class="footer2" id="footer2" align="center">
    	Copyright © 电子科技大学 2013 All Rights Reserved <br />
			推荐使用IE8.0以上浏览器，1024*768以上分辨率访问本网站
    </div>
    <script>
		$("#accordion").accordion({
			collapsible : true,
			active : 0
		});
		
		for (var i = 0; i <= 3; i++) {
			$("#button" + i).button({});
		};
    </script>
</div>
</body>
</html>